package com.avocado.configuration.entity;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;



import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.avocado.persistence.entity.VersionEntity;
import lombok.Data;


@Entity
@Table(name="AVO_ID_GENERATOR")
@JsonAutoDetect
@JsonIgnoreProperties(value={"handler","hibernateLazyInitializer"})
@Data
public class IdGenerator extends VersionEntity{
	
	@Id@Column(name="ID",nullable=false)
	@GeneratedValue(strategy = GenerationType.TABLE,generator="id_gen")
    @TableGenerator(name = "id_gen",pkColumnValue="ID_GENERATOR_ID",table="AVO_ID_GENERATOR", pkColumnName="GEN_NAME",valueColumnName="GEN_VALUE",allocationSize=1)
	private long id;
	
	@Column(name="GEN_NAME",nullable=false,unique=true)
	private String genName;
	
	@Column(name="GEN_VALUE")
	private long genValue;
	
	@Column(name="MEMO")
	private String memo;

	@Override
	public Long getId() {
		// TODO Auto-generated method stub
		return id;
	}
	
	

}
